execute if entity @e[type=item_frame,nbt={Tags:["wire"]},distance=..1,limit=1,sort=nearest,tag=!hasPower,tag=!finding] run tag @s remove hasPower
execute if entity @e[type=item_frame,nbt={Tags:["wire"]},distance=..1,limit=1,sort=nearest,tag=!hasPower,tag=!finding] run tag @e[type=item_frame,nbt={Tags:["wire"]},distance=..1,limit=1,sort=nearest,tag=!hasPower,tag=!finding] add hasPower

execute if entity @e[type=item_frame,nbt={Tags:["wire_spread"]},distance=..1,limit=1,sort=nearest,tag=!hasPower,tag=!finding] run tag @s remove hasPower
execute if entity @e[type=item_frame,nbt={Tags:["wire_spread"]},distance=..1,limit=1,sort=nearest,tag=!hasPower,tag=!finding] run tag @e[type=item_frame,nbt={Tags:["wire_spread"]},distance=..1,limit=1,sort=nearest,tag=!hasPower,tag=!finding] add hasPower